.aad-mask,
.aap-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(55, 55, 55, 0.35);
    z-index: 999;
    pointer-events: none;
}

.aad-wrap,
.aap-wrap {
    z-index: 999;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.aad {
    width: 80vw;
    background-color: #fff;
    border-radius: 1.5vw;
    box-shadow: 0 0.5vw 1.8vw rgba(55, 55, 55, 0.35);
    position: relative;
    margin-top: -10vw;
    .aad-close {
        position: absolute;
        right: 3vw;
        top: 1vw;
    }
}
// mask动画效果
@mixin fade-effect() {
    animation-duration: .3s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
}

.aad-fade-enter,
.aad-fade-appear,
.aap-fade-enter,
.aap-fade-appear {
    opacity: 0;
    @include fade-effect();
}

.aad-fade-leave,
.aap-fade-leave {
    @include fade-effect();
}

.aad-fade-enter.aad-fade-enter-active,
.aad-fade-appear.aad-fade-appear-active,
.aap-fade-enter.aap-fade-enter-active,
.aap-fade-appear.aap-fade-appear-active {
    animation-name: rcDialogFadeIn;
    animation-play-state: running;
}

.aad-fade-leave.aad-fade-leave-active,
.aap-fade-leave.aap-fade-leave-active {
    animation-name: rcDialogFadeOut;
    animation-play-state: running;
}

@keyframes rcDialogFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes rcDialogFadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

// dialog动画效果
@mixin effect() {
    animation-duration: 0.3s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0, .1, .3, 1);
    animation-play-state: paused;
    position: relative;
}

.aad-fall-enter,
.aad-fall-appear {
    opacity: 0;
    @include effect();
}

.aad-fall-leave {
    @include effect();
}

@keyframes adfallIn {
    0% {
        opacity: 0.5;
        transform: translate3d(0, -20vw, 0)scale(0.8, 0.8);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0)scale(1, 1);
    }
}
@keyframes adfallOut {
    0% {
        opacity: 1;
        transform: fall(1, 1);
    }

    50% {
        transform: fall(1.105, 1.105);
    }

    100% {
        opacity: 0.05;
        transform: fall(0.7, 0.7);
    }
}

.aad-fall-enter.aad-fall-enter-active,
.aad-fall-appear.aad-fall-appear-active {
    animation-name: adfallIn;
    animation-play-state: running;
    position: relative;
}

.aad-fall-leave.aad-fall-leave-active {
    animation-name: adfallOut;
    animation-play-state: running;
    position: relative;
}


// 放大动画
.aad-scale-enter,
.aad-scale-appear {
    opacity: 0;
    @include effect();
}

.aad-scale-leave {
    @include effect();
}

.aad-scale-enter.aad-scale-enter-active,
.aad-scale-appear.aad-scale-appear-active {
    animation-name: adscaleIn;
    animation-play-state: running;
    position: relative;
}

.aad-scale-leave.aad-scale-leave-active {
    animation-name: adscaleOut;
    animation-play-state: running;
    position: relative;
}

@keyframes adscaleIn {
    0% {
        opacity: 0.2;
        transform: scale(0.4, 0.4);
    }

    55% {
        transform: scale(1.1, 1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1, 1);
    }
}
@keyframes adscaleOut {
    0% {
        opacity: 1;
        transform: scale(1, 1);
    }

    50% {
        transform: scale(1.105, 1.105);
    }

    100% {
        opacity: 0.2;
        transform: scale(0.7, 0.7);
    }
}
// 弹出动画
.aad-bounce-enter,
.aad-bounce-appear {
    opacity: 0;
    @include effect();
}

.aad-bounce-leave {
    @include effect();
}

.aad-bounce-enter.aad-bounce-enter-active,
.aad-bounce-appear.aad-bounce-appear-active {
    animation-name: adBounceIn;
    animation-play-state: running;
    position: relative;
}

.aad-bounce-leave.aad-bounce-leave-active {
    animation-name: adBounceOut;
    animation-play-state: running;
    position: relative;
}

@keyframes adBounceIn {
    0% {
        opacity: 0.15;
        transform: translate3d(0, 4vw, 0);
    }

    45% {
        transform: translate3d(0, -1.5vw, 0);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes adBounceOut {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);

    }

    100% {
        opacity: 0.1;
        transform: translate3d(0, 4vw, 0);
    }
}

//modal 样式
.aad-title {
    text-align: center;
    font-size: 4.2vw;
}

.aad-footer-btn-group {
    border-radius: $border-bottom-radius;
    overflow: hidden;
    border-top: 0.2vw solid rgba(55, 55, 55, 0.15);
    display: flex;
    & >.aad-footer-item {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: background-color .15s ease;
        letter-spacing: 0.2vw;
        color: $gray-600;
        border-right: 0.2vw solid rgba(55, 55, 55, 0.15);
        &:last-child {
            border-right: none;
        }
    }
    .aad-footer-item-active {
        @include TouchFeedbackActive();
    }

    & >.aad-footer-item-highlight {
        background-color: $primary;
        color: #fff;
    }
    .aad-footer-item-active-highlight {
        background-color: darken($color: $primary, $amount: 10%);
    }
}

// popup
.aap {
    position: fixed;
    left: 0;
    width: 100%;
    background-color: $white;

    &-slide-up {
        bottom: 0;
    }

    &-slide-down {
        bottom: 0;
    }
}

.aap .aap-header,
.aad .aad-header {
    font-size: .16rem;
    line-height: .4rem;
    text-align: center;
    color: $gray-600;
    border-bottom: 1px solid $gray-200;
}

.aap-fade-enter,
.aap-fade-appear {
    animation-duration: .45s;
}
.aad-fade-leave,
.aap-fade-leave {
    animation-duration: .45s;
}

@mixin apEffect() {
    animation-duration: 0.45s;
    animation-fill-mode: both;
    animation-timing-function: ease;
    animation-play-state: paused;
}

.aap-slide-up-enter,
.aap-slide-up-appear {
    transform: translate3d(0, 100%, 0);
    @include apEffect();
}

.aap-slide-up-leave {
    transform: translate3d(0, 0, 0);
    @include apEffect();
}

.aap-slide-up-enter.aap-slide-up-enter-active,
.aap-slide-up-appear.aap-slide-up-appear-active {
    animation-name: apSlideUpIn;
    animation-play-state: running;
}

.aap-slide-up-leave.aap-slide-up-leave-active {
    animation-name: apSlideUpOut;
    animation-play-state: running;
}

@keyframes apSlideUpIn {
    0% {
        transform: translate3d(0, 100%, 0);
    }
    100% {
        transform: translate3d(0 ,0 ,0);
    }
}

@keyframes apSlideUpOut {
    0% {
        transform:  translate3d(0, 0, 0);
    }
    100% {
        transform:  translate3d(0, 100%, 0);
    }
}

.aap-header {
    position: relative;
    .ararin-icon-close {
        cursor: pointer;
        width: .2rem;
        height: .2rem;
        position: absolute;
        right: .2rem;
        top: 50%;
        margin-top: -.1rem;
    }
}